# encoding: utf-8
# 健康文章模块
import mod_db


def get_detail(info_id):
    query = {'_id': info_id}
    doc = mod_db.find_one('hospital', 'health_article', query)
    if doc is None:
        return None
    else:
        return doc


def get_list():
    query = {}
    cursor = mod_db.find_list('hospital', 'health_article', query)
    res_list = []
    for unit in cursor:
        unit["url"] = "health_article_detail?id=" + str(unit["_id"])
        res_list.append(unit)
    return res_list
